package com.sap.mobile.maf.samples.android.mafprovisioningsample;

import java.util.ArrayList;

import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;

import com.sap.maf.uicontrols.MAFSkinManager;

public class SamplePreferenceActivity extends PreferenceActivity {
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferences);		
		PreferenceScreen root = this.getPreferenceScreen();
		
		ArrayList<String> styleNames = MAFSkinManager.getInstance(this).getStyleNames();
		styleNames.add("Default - Welter");
		CharSequence[] entries = styleNames.toArray(new String[styleNames.size()]);
		CharSequence[] entryValues = styleNames.toArray(new String[styleNames.size()]);
		ListPreference lp = new ListPreference(this);
		lp.setKey("themeID");
		lp.setTitle("Theme");
		lp.setEntries(entries);
		lp.setEntryValues(entryValues);
		
		root.addPreference(lp);
	}
	
	
}
